﻿using AutoMapper;
using ManagementApi.Models.Manage.ProjectGroupMember;
using ManagementApi.Mvc;
using Modules;
using Modules.Person;
using PmSoft;
using PmSoft.Exceptions;
using System.ComponentModel.DataAnnotations;

namespace ManagementApi.Models.Person
{
    public class PersonGroupMemberCreateForm
    {
        /// <summary>
        /// 人员信息
        /// </summary>
        public PersonCreateForm Person { get; set; }

        /// <summary>
        /// 班组信息
        /// </summary>
        public ProjectGroupMemberEditForm Member { get; set; }

        /// <summary>
        /// 人员工资卡
        /// </summary>
        public AddBankEditForm Bank { get; set; }

        /// <summary>
        /// 证书
        /// </summary>
        public IEnumerable<PersonCertificateForm>? certificates { get; set; }
    }

    public class AddBankEditForm
    {
        /// <summary>
        /// 发放工资银行名称
        ///</summary>
        [Display(Name = "发放工资银行名称")]
        public string? BankName { get; set; }

        /// <summary>
        /// 发放工资银行卡号
        ///</summary>
        [Display(Name = "发放工资银行卡号")]
        [RegularExpression(RegxPatterns.BankNo, ErrorMessage = "银行卡号只能为16-19位数字")]
        public string? CardNo { get; set; }
    }
}